﻿using System;
using System.Collections.ObjectModel;

namespace Web.VirtualProductHandler
{
    public class VirtualProductHandlerManager
    {
        private static VirtualProductHandlerManager current = new DefaultVirtualProductHandlerManager();
        
        private readonly Collection<IVirtualProductHandler> handlers;

        public Collection<IVirtualProductHandler> Handlers
        {
            get { return handlers; }
        }

        public static VirtualProductHandlerManager Current
        {
            get { return current; }
            set
            {
                if (value == null)
                {
                    throw new ArgumentNullException("value");
                }
                current = value;
            }
        }

        public VirtualProductHandlerManager()
        {
            handlers = new Collection<IVirtualProductHandler>();
        }
    }
}